<#assign t=JspTaglibs["/META-INF/tld/tiles-jsp.tld"] />
<#assign s=JspTaglibs["/META-INF/tld/struts-tags.tld"] />
<@s.url value="" var="cntxpth"/>
<@s.set name="contextPath" value="#cntxpth"  />
<@s.set name="templateName" value="#templateName"/>
<@s.set name="resourcePath">/${contextPath}templates/${templateName}</@s.set>

<@s.form  namespace="/profile" action="applyReassignedRoles" method="POST" theme="simple">
    <#assign itemCount = 0>
    <@s.set value="roles" var="currentUserRoles"/>
    <@s.iterator value="allRoles" var="rol">
    <input id="_applyReassignRoleForm_checked_${rol.id}" type="checkbox"
        <@s.if test="%{#currentUserRoles.contains(#rol)}">
           checked="checked"
        </@s.if>
    <#--checked="${currentUserGroups?seq_contains(grp)?string("checked", "")}"-->
           name="roles[${itemCount}].id" value="${rol.id}" /> <label for="_applyReassignRoleForm_checked_${rol.id}"><@s.property value="name"/></label>
        <#assign itemCount = itemCount+1>
    </@s.iterator>

    <@s.hidden name="user.id"/>
    <@s.submit/>

</@s.form>